Extensible Markup Language (XML) is a meta-markup language that provides a format for describing structured data. XML is a subset of Standard Generalized Markup Language (SGML) that provides a uniform method for describing and exchanging structured data in an open, text-based format, and delivers this data by use of standard HTTP protocol. XML utilizes the concepts of elements and namespaces. XML is similar to HTML, but facilitates more precise declarations of content and more meaningful search results across multiple platforms.
XML “elements” are structural constructs that consist of a start tag, an end or close tag, and the information or content that is contained between the tags. A start tag is formatted as “<tag name>” and an end tag is formatted as “</tag name>”. In an XML document, start and end tags can be nested within other start and end tags. All elements that occur within a particular element must have their start and end tags occur before the end tag of that particular element. This defines a strict tree-like structure that can be used to generate an XML document, or by an XML parser to organize and parse the XML document. Each element forms a node in this tree, and potentially has “child” or “branch” nodes. The child nodes represent any XML elements that occur within the start and end tags of the “parent” node.
XML accommodates an infinite number of database schemas. Within each schema, data is represented by element names. Each schema is able to define its own “dictionary” of element names, referred to as a “namespace.” Namespace identifiers are used within an XML document to qualify element names, thereby allowing the same names to be used within different schemas.
Namespace inheritance within an XML document allows non-qualified names to use “default” namespaces. The default namespace for any particular XML element is whatever default namespace is applicable to the parent of the particular element. A namespace specification within an XML document is said to have a “scope” which includes all child nodes beneath the namespace specification.
Typically, XML documents are exchanged between different entities, such as client and server computers, in the form of requests and responses. A client might generate a request for information or a request for a certain server action, and a server might generate a response to the client that contains the information or confirms whether the certain action has been performed. In many cases, it is convenient to represent these XML documents in memory as a hierarchical tree structure. Once the hierarchical tree structure is built, the actual XML document in proper syntactic form can then be assembled. Consider the following exemplary XML code:
<ordersxmlns:person=“http://www.schemas.org/people”xmlns:dsig=“http://dsig.org”><order><sold-to><person:name><person:last-name>Layman</person:last-name><person:first-name>Andrew</person:first-name></person:name></sold-to><sold-on>1997-03-17</sold-on><dsig:digital-signature>1234567890</dsig:digital-signature></order></orders>
This code includes two XML namespace declarations that are each designated with “xmlns”. The declarations include a prefix, e.g. “person” and “dsig” respectively, and the expanded namespace to which each prefix refers, e.g. “http://www.schemas.org/people”, and “http://dsig.org” respectively. This code tells any reader that if an element name begins with “dsig:” its meaning is defined by whoever owns the “http://www.dsig.org” namespace. Similarly, elements beginning with the “person:” prefix have meanings defined by the “http://www.schemas.org/people” namespace.
Namespaces ensure that element names do not conflict, and clarify who defined which term. They do not give instructions on how to process the elements. Readers still need to know what the elements mean and decide how to process them. Namespaces simply keep the names straight.
FIG. 1 shows how the structure of the above code can be represented in a hierarchical tree structure. In FIG. 1, all of the elements or nodes are set out in an exemplary tree that represents the XML document. Such a structure is typically constructed in memory, with each node containing all data necessary for the start and end tags of that node.
It has been typical in the past to build the entire tree structure, such as the one shown in FIG. 1, before building an XML document itself. For large XML documents, this can consume a great deal of memory and processor time. Thus, it would be desirable to avoid this process if at all possible.
Accordingly, this invention arose out of concerns associated with providing improved methods and systems for generating XML documents that do not require or need a hierarchical tree structure to be built and stored in memory in order for the XML document to be generated.